<!DOCTYPE html>
<html class="x-admin-sm">
  <head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.1</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>

    <script src="__ADMIN__/plus/ueditor/ueditor.config.js"></script>
    <script src="__ADMIN__/plus/ueditor/ueditor.all.min.js"></script>
<style type="text/css">
.layui-anim {z-index: 9999 !important}  

</style>
  </head>
  
  <body>
    <div class="x-body">
        <form class="layui-form" lay-filter="form">
            <input type="hidden" name="client_id" value="{$clients.id}" />
            <input type="hidden" name="xuqi_id" value="{$xuqi.id}" />
          <div class="layui-form-item">
              <label for="name" class="layui-form-label">
                 客户姓名
              </label>
              <label for="name" class="layui-form-label" style="text-align:left;">
                  {$clients.name}
              </label>
          </div>
          <div class="layui-form-item">
              <label for="name" class="layui-form-label">
                 续期状态
              </label>
              <label for="name" class="layui-form-label" style="text-align:left;">
              {switch name="xuqi.status "}
              {case value="0"}待审核{/case}
              {case value="1"}审核通过{/case}
              {case value="2"}审核未通过{/case}
              {default /}
              {/switch}
              </label>
          </div>
          <div class="layui-form-item">
              <label for="time" class="layui-form-label">
                  续期时间
              </label>
              <div class="layui-input-block" style="width:260px;">
                  <select name="time" lay-verify="required">
                    <option value="3">3天</option>
                    <option value="5">5天</option>
                    <option value="7">7天</option>
                    <option value="10">10天</option>
                    <option value="15">15天</option>
                    <option value="20">20天</option>
                    <option value="30">30天</option>
                  </select>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="username" class="layui-form-label">
                  申请原因
              </label>
              <div class="layui-input-block" style="">
                  <textarea type="text" name="desc" id="desc" >{$xuqi.desc}</textarea>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" lay-filter="add" lay-submit="">
                  {if condition="$xuqi.id"}修改续期{else /}申请续期{/if}
              </button>
          </div>
      </form>
    </div>
    <script>
    UE.getEditor('desc',{initialFrameWidth:'80%',initialFrameHeight:800});
        layui.use(['form','layer','laydate'], function(){
          $ = layui.jquery;
          var form = layui.form
          ,layer = layui.layer
          ,laydate = layui.laydate;
          form.val('form', {
            "time": "{$xuqi.time}" 
          });
          //监听提交
          form.on('submit(add)', function(data){
            $.ajax({
                type:'POST',
                dataType:'json',
                data:{data:data.field},
                url:"{:url('Client/xuqi')}",
                success:function(obj){
                  layer.msg(obj.msg, {icon: obj.icon,time: 2000},function(){
                    // 获得frame索引
                    var index = parent.layer.getFrameIndex(window.name);
                    //关闭当前frame
                    parent.layer.close(index);
                    // 可以对父窗口进行刷新 
                    x_admin_father_reload();
                  });
                }
            });
            return false;
          });
          
          
        });
    </script>
  </body>

</html>